import React, {Component} from 'react';
import PropTypes from 'prop-types'

import Item from '../item/item'

export default class ItemList extends Component {

    static propTypes = {
        comments: PropTypes.array.isRequired
    }

    render() {
        const {comments} = this.props
       return (
           <div>
               {
                   comments.map((comment, index) => <Item  comment={comment} key={index}/>)
               }
           </div>
       )
    }

}
